<script>
import TopBar from '../components/Topbar.vue';
export default {
    components: {
        TopBar
    },
    data() {
        return {
            tags: ['小米电饭煲', '小米Max 2', '红米Note 5A', '红米Note 4X'],
            bgColors: ['rgb(232, 246, 246)', 'rgb(248, 242, 236)', 'rgb(249, 234, 234)', 'rgb(228, 245, 226)']
        }
    }
}
</script>
<template>
    <div class="page">
        <TopBar>
            <input type="text" class="search-input" placeholder="搜索商品名称" :autofocus="true" />
            <div class="search-btn" name="right">
                <text class="search-txt">搜索</text>
            </div>
        </TopBar>
        <div class="tag-list">
            <div class="tag-item" v-for="(tag,$index) in tags" :style="{'background-color':bgColors[$index]}" :key="tag">
                <text class="tag-item-txt">{{tag}}</text>
            </div>
        </div>
    </div>
</template>
<style scoped>
.search-input {
    height: 60px;
    flex: 2;
    background-color: #fff;
    flex-grow: 1;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding-left: 15px;
    margin-right: 20px;
    margin-left: 20px;
}

.search-btn {
    width: 100px;
    height: 60px;
    justify-content: center;
    align-items: center;
}

.search-txt {
    text-align: center;
    font-size: 30px;
    color: #666;
}

.tag-list {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.tag-item {
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
    margin-left: 25px;
    margin-top: 20px;
}

.tag-item-txt {
    font-size: 20px;
}
</style>

